home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / complib / csfft3du.z / csfft3du
Encoding:
Text File  |  1998-10-30  |  9.4 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ccccssssfffffffftttt3333dddduuuu,,,,zzzzddddfffffffftttt3333dddduuuu((((3333FFFF))))                                    ccccssssfffffffftttt3333dddduuuu,,,,zzzzddddfffffffftttt3333dddduuuu((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ccccssssfffffffftttt3333dddduuuu,,,, zzzzddddfffffffftttt3333dddduuuu ---- 3D, Complex to Real, Inverse Fast Fourier
  10.      Transforms.
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  13.      _F_o_r_t_r_a_n :
  14.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ccccssssfffffffftttt3333dddduuuu((((ssssiiiiggggnnnn,,,,nnnn1111,,,,nnnn2222,,,,nnnn3333,,,,aaaarrrrrrrraaaayyyy,,,,llllaaaa1111,,,,llllaaaa2222,,,,ccccooooeeeeffff))))
  15.           iiiinnnntttteeeeggggeeeerrrr            ssssiiiiggggnnnn,,,, nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, llllaaaa1111,,,, llllaaaa2222
  16.           rrrreeeeaaaallll      aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333))))
  17.           rrrreeeeaaaallll    ccccooooeeeeffff((((((((nnnn1111++++11115555))))++++2222****((((nnnn2222++++11115555))))++++2222****((((nnnn3333++++11115555))))))))
  18.  
  19.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee zzzzddddfffffffftttt3333dddduuuu((((ssssiiiiggggnnnn,,,,nnnn1111,,,,nnnn2222,,,,nnnn3333,,,,aaaarrrrrrrraaaayyyy,,,,llllaaaa1111,,,,llllaaaa2222,,,,ccccooooeeeeffff))))
  20.           iiiinnnntttteeeeggggeeeerrrr            ssssiiiiggggnnnn,,,, nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, llllaaaa1111,,,, llllaaaa2222
  21.           rrrreeeeaaaallll****8888  aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333))))
  22.           rrrreeeeaaaallll****8888  ccccooooeeeeffff((((((((nnnn1111++++11115555))))++++2222****((((nnnn2222++++11115555))))++++2222****((((nnnn3333++++11115555))))))))
  23.  
  24.  
  25.      _C :
  26.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  27.      iiiinnnntttt ccccssssfffffffftttt3333dddduuuu((((iiiinnnntttt ssssiiiiggggnnnn,,,,iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,iiiinnnntttt nnnn3333,,,,ffffllllooooaaaatttt ****aaaarrrrrrrraaaayyyy,,,,
  28.                     iiiinnnntttt llllaaaa1111,,,, iiiinnnntttt llllaaaa2222,,,, ffffllllooooaaaatttt ****ccccooooeeeeffff))));;;;
  29.      iiiinnnntttt zzzzddddfffffffftttt3333dddduuuu((((iiiinnnntttt ssssiiiiggggnnnn,,,,iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,iiiinnnntttt nnnn3333,,,,ddddoooouuuubbbblllleeee ****aaaarrrrrrrraaaayyyy,,,,
  30.                     iiiinnnntttt llllaaaa1111,,,, iiiinnnntttt llllaaaa2222,,,, ddddoooouuuubbbblllleeee ****ccccooooeeeeffff))));;;;
  31.  
  32.  
  33. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  34.      ccccssssfffffffftttt3333dddduuuu and zzzzddddfffffffftttt3333dddduuuu compute in place the real 3D sequence  of size N1 x
  35.      N2 x N3 from its complex Fourier transform.  The value F{j1,j2,j3} of the
  36.      transform of the 3D sequence f{i1,i2,i3} is equal to:
  37.          F{j1,j2,j3} = Sum( W1^(i1*j1)*W2^(i2*j2)*W3^(i3*j3)*f{i1,i2,i3} ),
  38.                   for i[123] =0,...,(N[123]-1)
  39.               W[123] = exp( (Sign*2*sqrt(-1)*PI) / N[123] )
  40.  
  41.  
  42. SSSSttttoooorrrraaaaggggeeee
  43.      It is assumed that the (N1 x N2 x N3) 3D sequence is stored along
  44.      dimension N1.  So the index {i+1,j,l} has an offset of 1 element with
  45.      respect to {i,j,l}, and {i,j+1,k} an offset of _l_a_1 elements with respect
  46.      to {i,j,k}, and {i,j,k+1} an offset of (_l_a_1*_l_a_2) elements with respect to
  47.      {i,j,k}.
  48.      NNNNOOOOTTTTEEEE :::: la1 must be larger (or equal) to 2*((N1+2)/2), and la2 larger (or
  49.      equal) to N2.
  50.  
  51.  
  52. AAAAllllggggoooorrrriiiitttthhhhmmmm
  53.      The real-to-complex Direct 3D Fourier transform is computed with a row-
  54.      column approach.
  55.       - First, N1*N2 FFTs complex-to-complex of size N3 are performed,
  56.      stride=(la1/2)*la2, and leading_dimension=1.
  57.       - then, N3 2D FFTs real-to-complex of size N1xN2 are evaluated, stride =
  58.      1
  59.       and leading_dimension=la1.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccssssfffffffftttt3333dddduuuu,,,,zzzzddddfffffffftttt3333dddduuuu((((3333FFFF))))                                    ccccssssfffffffftttt3333dddduuuu,,,,zzzzddddfffffffftttt3333dddduuuu((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      As the final output sequence has real values, only half of the transform
  75.      are needed since the sample {(N1-k),l,m} of the real-to-complex transform
  76.      is be the conjugate of the sample {k,l,m}.
  77.      However, some extra space is necessary, and the relation
  78.      (la1>=2*((N1+2)/2)) must hold.
  79.  
  80.  
  81. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  82.      SSSSIIIIGGGGNNNN Integer specifying which sign to be used for the expression of W
  83.      (see above) - must be either +1 or -1.
  84.      Unchanged on exit.
  85.  
  86.      NNNN1111 Integer, the first dimension size of the 3D sequence.  Unchanged on
  87.      exit.
  88.  
  89.      NNNN2222 Integer, the second dimension size of the 3D sequence.  Unchanged on
  90.      exit.
  91.  
  92.      NNNN3333 Integer, the third dimension size of the 3D sequence.  Unchanged on
  93.      exit.
  94.  
  95.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the 3D sequence to be transformed.
  96.      On input, the element {i,j,k} of the sequence is stored as A(i,j,k) in
  97.      _F_o_r_t_r_a_n , and A[i+j*la1+k*la1*la2] in _C. On exit, the array is
  98.      overwritten.
  99.  
  100.      LLLLAAAA1111 Integer, first leading dimension: increment between the samples of
  101.      two consecutive 1D sub-sequences (e.g between {i,j+1,k} and {i,j,k} ).
  102.      Unchanged on exit.
  103.  
  104.      LLLLAAAA2222 Integer, second leading dimension: number of the 1D sub-sequence
  105.      between two consecutive 2D sub-sequences (e.g between {i,j,k+1} and
  106.      {i,j,k}).  Unchanged on exit.
  107.  
  108.      CCCCOOOOEEEEFFFFFFFF Array of at least ( (N1+15)+2*(N2+15)+2*(N3+15) ) elements.  On
  109.      entry it contains the Sines/Cosines and factorization of N. COEFF needs
  110.      to be initialized with a call to scfft3dui or dzfft3dui.  Unchanged on
  111.      exit.
  112.  
  113.  
  114. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  115.      3D FFT computed on a real sequence of size 100x64x125. The elements of
  116.      each sequence are stored with increment (stride) 1, the offset between
  117.      the first element of two succesive 1D sub-sequences (first leading
  118.      dimension) is 102, and the number of 1D sub-sequence between two
  119.      succesive 2D sub-sequences (second leading dimension) is 64.
  120.      Note : 102 >= 100+2 , and 64 >= 64.
  121.      _F_o_r_t_r_a_n
  122.           real array(0:102-1,0:64-1,0:125-1)
  123.           real coeff(100+15 + 2*(64+15) + 2*(125+15))
  124.           call scfft3dui( 100, 64, 125, coeff)
  125.           call scfft3du( -1, 100, 64, 125, array, 102, 64, coeff)
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ccccssssfffffffftttt3333dddduuuu,,,,zzzzddddfffffffftttt3333dddduuuu((((3333FFFF))))                                    ccccssssfffffffftttt3333dddduuuu,,,,zzzzddddfffffffftttt3333dddduuuu((((3333FFFF))))
  137.  
  138.  
  139.  
  140.          call csfft3du(  1, 100, 64, 125, array, 102, 64, coeff)
  141.  
  142.      _C
  143.           #include <fft.h>
  144.           float array[102*64*125], *coeff;
  145.           coeff = scfft3dui( 100, 64, 125, NULL);
  146.           scfft3du( -1, 100, 64, 125, array, 102, 64, coeff)
  147.           csfft3du(  1, 100, 64, 125, array, 102, 64, coeff)
  148.  
  149. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  150.      fft, scfft3dui, dzfft3dui, scfft3du, dzfft3du
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.